import React, { Children } from 'react'
import { createBrowserRouter, Navigate,createHashRouter } from 'react-router-dom'
import { lazyLoad } from './LazyLoad'
import Layout from '@/views/layout'
import Home from '@/views/home'
import My from '@/views/my'
import Login from '@/views/login'
import Register from '@/views/register'
import Message from '@/views/message'
import NoteEdit from '@/views/noteEdit'


export const router = [
  {
    path: '/',
    element: <Navigate to='/layout/home' />
  },
  {
    path: '/layout',
    element: <Layout />,
    children: [
      { path: 'home', element: lazyLoad(React.lazy(() => import('@/views/home'))) } ,
      { path: 'noteEdit', element: <NoteEdit />},
      { path: 'my', element: <My /> },
      { path:'message', element: <Message /> },
    ] 
  },
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '/register',
    element: <Register />
  }
 
  

]

export default createHashRouter(router)
